package optimizers.ganeat.math;

import java.util.Map;
import javax.swing.JPanel;
import javax.swing.JProgressBar;

import org.w3c.dom.Element;

import common.RunStatus;

import optimizers.commons.RunConfig;
import optimizers.ganeat.GA;
import optimizers.ganeat.Individual;
import runconfiguration.MathConfiguration;
import visualization.GraphDisplayer;

public class GAMath extends GA {
	String initIndiv = "Node gens:\r\n" + 
			" a 53.2 0 TCGAGTCGGAA\r\n" + 
			" b 191.41 10 TGGAGTCACAG\r\n" + 
			" c 261.65 10 CTGAGTCCCTT\r\n" + 
			" Ibb 1.9141 10 null\r\n" + 
			" g 61.76 10 CTGAGTCGGTG\r\n" + 
			" Icg 1.2712 10 null\r\n" + 
			" v 261.65 10 CTGAGTCCCTT\r\n" + 
			" Ivv 2.6165 10 null\r\n" + 
			" Icc 2.6165 10 null\r\n" + 
			"Connection gens:\r\n" + 
			" 1 a->a false 3.7959\r\n" + 
			" 2 a->b false 10\r\n" + 
			" 3 c->c true 25\r\n" + 
			" 5 b->b true 25\r\n" + 
			" 6 c->Ibb true 25\r\n" + 
			" 11 a->Ibb true 10.3798\r\n" + 
			" 15 c->g true 20.5197\r\n" + 
			" 16 g->c false 28.67\r\n" + 
			" 17 a->Icg true 37.29\r\n" + 
			" 18 b->Ibb true 20.8566\r\n" + 
			" 91 v->v true 32.8398\r\n" + 
			" 92 g->Ivv true 22.9005\r\n" + 
			" 93 v->Icc true 24.9227\r\n" + 
			"Exo: 0.6818\r\n" + 
			"Pol: 17\r\n" + 
			"Nick: 3";

	public GAMath(RunConfig config, JPanel panelFitness, JPanel panelSpecies,
			JPanel panelIndiv, RunStatus runStatus, JProgressBar progressBar,
			Element fitnessElement) {
		super(config, panelFitness, panelSpecies, panelIndiv, runStatus,
				progressBar, fitnessElement);
	}

	public GAMath(RunConfig config, String initIndiv, JPanel panelFitness,
			JPanel panelSpecies, JPanel panelIndiv, RunStatus runStatus,
			JProgressBar progressBar, Element fitnessElement) {
		super(config, panelFitness, panelSpecies, panelIndiv, runStatus,
				progressBar, fitnessElement);
		this.initIndiv = initIndiv;
	}

	@Override
	public Individual getInitialIndividual() {
		return new IndividualMath(innovations, nodeNames, -1, 0, config,
				initIndiv);
	}

	@Override
	public Individual getNewIndividual(Map<String, Integer> innovations2,
			Map<String, String> nodeNames2, int i, int j) {
		return new IndividualMath(innovations2, nodeNames2, i, j, config);
	}

	@Override
	public String getProblemName() {
		// TODO Auto-generated method stub
		return "Math";
	}

}
